import { requestClient } from '#/api/request';

/**
 * 获取用户信息
 */
export async function getUserInfoApi() {
  // return requestClient.get<UserInfo>('/user/info');
  return {};
}

/**
 * 获取用户信息
 */
export async function getActiveListApi() {
  return requestClient.get<any>('/upload/album/getDateList');
}

// 获取oss签名

interface QueryParams {
  dirname: string;
  ext: string;
  full_name?: string; // 可选字段
  [key: string]: string | undefined; // 允许添加其他字符串类型的参数
}
export async function getOssSignApi(params: QueryParams) {
  // 将对象转换为查询字符串
  const queryString = Object.entries(params)
    .map(
      ([key, value]) =>
        `${encodeURIComponent(key)}=${encodeURIComponent(value)}`,
    )
    .join('&');

  return requestClient.get<any>(`/upload/album/getOssSign?${queryString}`);
}

// 上传图片url
export async function uploadImagesApi(data: any) {
  return requestClient.post<any>('/upload/album/uploadImages', data);
}
